
#ifndef MYMENUBAR_H
#define MYMENUBAR_H


#include <QMenuBar>
#include <QMenu>


//菜单栏的设计，包括退出游戏和规则的说明以及游戏基本情况的说明
#define CreateMenuBar() \
{\
        QMenuBar * bar = menuBar();\
        setMenuBar(bar);\
        QMenu * startMenu = bar->addMenu("开始");\
    QAction * quitAction = startMenu->addAction("退出");\
    \
        QMenu * helpMenu  = bar->addMenu("帮助");\
    QAction * descAction  = helpMenu->addAction("规则");\
    QAction * aboutAction = helpMenu->addAction("关于");\
    \
        connect(quitAction, &QAction::triggered, this, [=](){\
                this->close();\
        });\
    \
        connect(descAction, &QAction::triggered, this, [=](){\
                QMessageBox::about(this,"规则说明", "规则说明: \n" \
                                          "  游戏一共有20个关卡，每个关卡中都有4*4个币图\n" \
                                          "  币图分为银币和金币，让页面中的每个币图都翻为\n" \
                                          "  金币就可以胜利。");\
    });\
    \
        connect(aboutAction, &QAction::triggered, this, [=](){\
                QMessageBox::about(this,"关于本应用", "软件名称：懒羊羊的翻金币大作战 \n"\
                                           "开发作者：Hann\n"\
                                           "开发主题: 懒羊羊 \n"\
                                           "开发目的：创建以懒羊羊为主题的小游戏 \n"\
                                           "修改时间: 2023年5月");\
    });\
}


#endif // MYMENUBAR_H
